<#include "/common/head.html"/>

<div class="easyui-panel addPage" data-options="fit:true,border:false">
	<form id="ff" method="post" class="easyui-form"
		data-options="novalidate:true">
		<table class="table1">
			<tr>
				<th><span>作业名称：</span></th>
				<td><input class="easyui-textbox" data-options="required:true"
					type="text" name="job_name" value="${model.job_name!}"></input></td>
				<th><span>作业执行类：</span></th>
				<td><input class="easyui-textbox" type="text" name="job_class" value="${model.job_class!}"></input>
				</td>
			</tr>
			<tr>
				<th><span>分组：</span></th>
				<td><input class="easyui-textbox" type="text" name="job_group" value="${model.job_group!}"></input>
				</td>
				<th><span>周期任务时间规则：</span></th>
				<td><input class="easyui-textbox" type="text" name="job_cron" value="${model.job_cron!}"></input>
				</td>

			</tr>
			<tr>
				<th><span>作业类型：</span></th>
				<td><input class="easyui-textbox" type="text" name="job_type"  value="${model.job_type!}"></input>
				</td>
				<th><span>执行时间：</span></th>
				<td><input class="easyui-datebox" type="text" name="start_time" value="${model.start_time!}"></input>
				</td>
			</tr>
		</table>
	</form>
</div>
<script>
$(function() {
	top.window.subPage.save = save;

function save(successFunc) {
	if($("#ff").form('enableValidation').form('validate')) {
		$.post("${basePath}/job/update", getParam(), function(data) {
			if(successFunc) {
				successFunc();
			}
			top.window.closeWindow();
			top.window.subPage.loadCurrDatagrid();
		});
	}
}
function getParam() {
	var param = {
		"model.id": ${model.id},
		"model.job_name": $(":input[name='job_name']").val(), 
  	    "model.job_class": $(":input[name='job_class']").val(), 
  	    "model.job_group": $(":input[name='job_group']").val(), 
  	    "model.job_cron": $(":input[name='job_cron']").val(), 
   	    "model.job_type": $(":input[name='job_type']").val(),
   		"model.start_time": $(":input[name='start_time']").val()
	}
	for(key in param) {
		if(!param[key]) {
			delete param[key];
		}
	}
	return param;
}
});
</script>
<#include "/common/foot.html"/>
